const tools = require('../mModules/loginCode/tools.js')
const unCode = require('../data/unCode')


module.exports = (req, res, next) => {
  // console.log(req.body.tel)
  const tel = req.body.tel
  const code = req.body.code
  tools(tel, code).then(res => {
  // 用户获取验证码成功
  // console.log(res);
  // console.log(code)
  unCode.insertMany({ unCode: tel + ',' + code }).then(res => {
    return unCode.find()
  }).then(res => { console.log(res) })
  })
  res.send('成功')
}



